
#region Imported Namespaces
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Windows.Forms;
#endregion

namespace UtilityTest
{
	/// <summary>
	/// The SprocResult class displays the contents of a DataSet in a DataGrid.
	/// </summary>
	public class SprocResult : Form
	{
		#region Instance Variables
		private Container	components = null;
		private DataGrid	dataGrid;
		private DataSet		dataSet;
		#endregion

		#region Constructor
		public SprocResult(DataSet dataSet)
		{
			InitializeComponent();
			this.dataSet = dataSet;
		}
		#endregion

		#region Overrides
		protected override void Dispose(bool disposing)
		{
			if (disposing && (components != null))
				components.Dispose();
			base.Dispose(disposing);
		}
		#endregion

		#region Event Handlers
		private void OnLoad(object sender, System.EventArgs e)
		{
			dataGrid.SetDataBinding(dataSet, "Table");

			DataGridTableStyle tableStyle = new DataGridTableStyle();
			tableStyle.MappingName = "Table";
			dataGrid.TableStyles.Clear();
			dataGrid.TableStyles.Add(tableStyle);

			foreach (DataGridColumnStyle style in dataGrid.TableStyles["Table"].GridColumnStyles)
				style.Width = 50;
		}
		#endregion

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.dataGrid = new System.Windows.Forms.DataGrid();
			((System.ComponentModel.ISupportInitialize)(this.dataGrid)).BeginInit();
			this.SuspendLayout();
			// 
			// dataGrid
			// 
			this.dataGrid.AllowNavigation = false;
			this.dataGrid.AllowSorting = false;
			this.dataGrid.CaptionVisible = false;
			this.dataGrid.CausesValidation = false;
			this.dataGrid.DataMember = "";
			this.dataGrid.Dock = System.Windows.Forms.DockStyle.Fill;
			this.dataGrid.HeaderForeColor = System.Drawing.SystemColors.ControlText;
			this.dataGrid.Location = new System.Drawing.Point(0, 0);
			this.dataGrid.Name = "dataGrid";
			this.dataGrid.ParentRowsVisible = false;
			this.dataGrid.ReadOnly = true;
			this.dataGrid.RowHeadersVisible = false;
			this.dataGrid.Size = new System.Drawing.Size(292, 273);
			this.dataGrid.TabIndex = 0;
			// 
			// SprocResult
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(292, 273);
			this.Controls.Add(this.dataGrid);
			this.Name = "SprocResult";
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
			this.Text = "SprocResult";
			this.Load += new System.EventHandler(this.OnLoad);
			((System.ComponentModel.ISupportInitialize)(this.dataGrid)).EndInit();
			this.ResumeLayout(false);

		}
		#endregion
	}
}

// --- EOF ---
